<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Withdraw extends Model
{
    public function user()
    {
        return $this->belongsTo('App\Models\WechatUser');
    }

    public function statusDesc($status = null)
    {
        $arr = [
            0 => "取消",
            10 => "处理中",
            20 => "已完成",
        ];
        if ($status !== null) {
            return array_key_exists($status, $arr) ? $arr[$status] : $arr['0'];
        }
        return $arr;
    }
}
